package org.fatmansoft.teach.entity.ViewEntity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "student",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"id"})
        })
public class Student {
    @Id
//    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;  //表示学生的学号

    @NotBlank
    @Size(max = 50)
    private String studentName;  //学生姓名

    private String sex;

    private Integer age;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    private String cellPhone;

    private String address;

}
